<%@page pageEncoding="UTF-8" isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="f" uri="http://www.slim3.org/functions"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>todo Index</title>
<link rel="stylesheet" type="text/css" href="/css/global.css" />
</head>
<body>
<p>TODO-LIST</p>
<a href="${f:url('add')}">追加</a>
総件数：${f:h(count)} <a href="./?page=${page - 1}">＜前へ</a>　<a href="./?page=${page + 1}">次へ＞</a>
<table border="1" cellspacing="0">
<thead>
	<tr>
		<th width="100">状態</th>
		<th width="100">カテゴリ</th>
		<th width="200">内容</th>
		<th colspan="2">&nbsp;</th>
	</tr>
</thead>
<tbody>
<c:forEach var="e" items="${list}">
<tr>
	<c:set var="doneUrl" value="done?key=${e.stringKey}&page=${page}"/>
	<c:set var="editUrl" value="edit?key=${e.stringKey}"/>
	<c:set var="deleteUrl" value="delete?key=${e.stringKey}&page=${page}"/>
	<td><a href="${f:url(doneUrl)}">${f:h(e.status)}</a></td>
	<td>${f:h(e.category.name)}</td>
	<td>${f:h(e.content)}</td>
	<td><a href="${f:url(editUrl)}">Edit</a></td>
	<td><a href="${f:url(deleteUrl)}" onclick="return confirm('delete OK?')">Delete</a></td>
</tr>
</c:forEach>
</tbody>
</table>
- ${page + 1} ページ -
</body>
</html>
